package micropascalcomp;

/**
 * Class that stores a single entry worth of info for a give symbol table
 * @author Jason Welch, Codi Gann, Jamal Martin
 */
public class SymbolTableEntry {

    private String lexeme;
    private String kind;
    private String mode;
    private String type;

    public SymbolTableEntry(String lexeme, String kind, String type) {
        this.lexeme = lexeme;
        this.kind = kind;
        this.type = type;
    }

    public SymbolTableEntry(String lexeme, String kind, String type, String mode) {
        this(lexeme, kind, type);
        this.mode = mode;
    }

    public String getLexeme() {
        return lexeme;
    }
    
    public String getKind() {
        return kind;
    }

    public String getType() {
        return type;
    }

    public String getMode() {
        return mode;
    }

    public boolean compare(String comp) {
        if(comp.compareTo(lexeme) == 0){
            return true;
        } else {
            return false;
        }
    }
    
    public void print(){
        System.out.printf("| %10s | %5s | %8s | %5s |", lexeme, kind, type, mode);  
    }
}
